#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2021-08-04 23:08 
# @Author : 李中华
# @Email  : 1260429766@qq.com
# @File : responseCodeCheck.py 
from common.logger import Log
import json
logger = Log()

class ResponseCodeCheck:
    '''
    响应断言封装
    '''
    def code_all(self,respStatus,respText,code_suc):
        '''
        自定义封装
        :param respStatus:响应状态码
        :param respText:响应文本
        :param code_suc:断言
        :return:
        '''
        logger.info(f"实际响应结果：{respText}，响应状态码：{respStatus}")
        logger.info(f"预期响应状态码：{code_suc}")
        if respStatus in ("200","201","202","203","204","205","206"):
            self.http_code(respStatus,respText,code_suc)
        else:
            code_suc_Dic = json.loads(code_suc)
            respDic = {}
            self.cmpResult(respText,code_suc_Dic,respDic)

    def http_code(self,respStatus,respText,code_suc):
        if respStatus == int(code_suc):
            # 此处先这样处理，如果拦截行不通
            logger.info(f"执行通过\n响应结果{respText}\n响应状态{respStatus}")
        else:
            logger.info(f"执行不通过\n响应结果{respText}\n响应状态{respStatus}\n预期结果{code_suc}")

    def cmpResult(self, respText, code_suc_Dic, respDic):
        '''
        当断言不是200等数字时，需要对断言和结果进行比对
        :param respText: 响应结果
        :param code_suc_Dic: 断言转换为json
        :param respDic:空字典，存放响应结果处理后的字典
        :return:
        '''
        respResultJson = json.loads(respText)
        res = self.infoResult(respResultJson, respDic)
        count = 0
        for key,value in code_suc_Dic.items():
            if key in res.keys():
                if value == res[key]:
                    count += 1
                else:
                    logger.info(f"参数不匹配：\n实际结果{res[key]}\n预期结果{value}")
            else:
                logger.info(f"参数不匹配：\n实际结果{res}\n预期结果{code_suc_Dic}")
        if count > 0:
            logger.info("执行通过")
        else:
            logger.info("执行不通过")

    def infoResult(self, respResultJson, respDic):
        # 处理响应结果，并返回一个包含所有响应结果的关键字的字典
        if isinstance(respResultJson,dict):
            for key,value in respResultJson.items():
                if isinstance(value,dict):
                    self.infoResult(value,respDic)
                elif isinstance(value,list):
                    for i in value:
                        self.infoResult(i,respDic)
                else:
                    respDic[key] = value
        elif isinstance(respResultJson,list):
            for i in respResultJson:
                self.infoResult(i,respDic)
        return respDic

if __name__ == '__main__':
    code_suc = '{"robotId": "c4b71eb124a7418aa14d4dd0dd383fae"}'
    respStatus = None
    # print(respStatus in ("200","201","500"))
    rospText = '{"content":[{"robotTaskId":"8978d773cd16477baa37be161f29bff7","robotId":"4d472b34ab084aa4a6fb3e954bf33420","taskId":"d238df3119114ea2af9d7a1bacfd4c2e","oldExecTime":"2021-05-21 16:27","execTime":"2021-05-21 16:27","execStatus":2,"execIf":0,"waitDevice":"52ad5bd5d01644eb981dc69f552e1d73","endTime":"2021-05-21 16:30:38","bz":null,"task":{"taskId":"d238df3119114ea2af9d7a1bacfd4c2e","taskExecType":0,"taskType":0,"cron":"2021-05-21 15:53:34,2021-05-21 16:00:34","period":"","name":"2021052124","status":3,"createTime":"2021-05-21 16:27:09","execTime":"2021-05-21 16:30:38","road":0,"overTime":null,"creater":"admin","content":null,"devices":"993b0c3c0cb842f5a80af6046b556f0b,52ad5bd5d01644eb981dc69f552e1d73","endStatus":1,"result":null,"description":null,"robotId":"4d472b34ab084aa4a6fb3e954bf33420","periodStime":null,"periodEtime":null}},{"robotTaskId":"b1aa643ebe004e8d9f6b4dfe91e902e6","robotId":"4d472b34ab084aa4a6fb3e954bf33420","taskId":"fbc44a68a3fa468a97d1256e1a43ff43","oldExecTime":"2021-05-21 15:36","execTime":"2021-05-21 15:36","execStatus":2,"execIf":0,"waitDevice":"52ad5bd5d01644eb981dc69f552e1d73","endTime":"2021-05-21 15:38:57","bz":null,"task":{"taskId":"fbc44a68a3fa468a97d1256e1a43ff43","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052121","status":3,"createTime":"2021-05-21 15:36:41","execTime":"2021-05-21 15:38:57","road":0,"overTime":null,"creater":"admin","content":null,"devices":"993b0c3c0cb842f5a80af6046b556f0b,52ad5bd5d01644eb981dc69f552e1d73","endStatus":1,"result":null,"description":null,"robotId":"4d472b34ab084aa4a6fb3e954bf33420","periodStime":null,"periodEtime":null}},{"robotTaskId":"1eadc67c3c624d748aec01154d32c20d","robotId":"4d472b34ab084aa4a6fb3e954bf33420","taskId":"c1cc3929b3f74c548095e5eaffbacbd9","oldExecTime":"2021-05-21 15:29","execTime":"2021-05-21 15:29","execStatus":2,"execIf":0,"waitDevice":"52ad5bd5d01644eb981dc69f552e1d73","endTime":"2021-05-21 15:33:30","bz":null,"task":{"taskId":"c1cc3929b3f74c548095e5eaffbacbd9","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052120","status":3,"createTime":"2021-05-21 15:29:16","execTime":"2021-05-21 15:33:30","road":0,"overTime":null,"creater":"admin","content":null,"devices":"993b0c3c0cb842f5a80af6046b556f0b,52ad5bd5d01644eb981dc69f552e1d73","endStatus":1,"result":null,"description":null,"robotId":"4d472b34ab084aa4a6fb3e954bf33420","periodStime":null,"periodEtime":null}},{"robotTaskId":"b23c37a7e75d44539bd04364d7c8e38d","robotId":"4d472b34ab084aa4a6fb3e954bf33420","taskId":"66bf1e39a4214bb0b55d15dca2c22870","oldExecTime":"2021-05-21 15:18","execTime":"2021-05-21 15:18","execStatus":2,"execIf":0,"waitDevice":"52ad5bd5d01644eb981dc69f552e1d73","endTime":"2021-05-21 15:22:08","bz":null,"task":{"taskId":"66bf1e39a4214bb0b55d15dca2c22870","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052118","status":3,"createTime":"2021-05-21 15:18:00","execTime":"2021-05-21 15:22:08","road":0,"overTime":null,"creater":"admin","content":null,"devices":"993b0c3c0cb842f5a80af6046b556f0b,52ad5bd5d01644eb981dc69f552e1d73","endStatus":1,"result":null,"description":null,"robotId":"4d472b34ab084aa4a6fb3e954bf33420","periodStime":null,"periodEtime":null}},{"robotTaskId":"bf21075461854c50ab800430d0183f3c","robotId":"4d472b34ab084aa4a6fb3e954bf33420","taskId":"a32dd5333f1043798b4633bf8a55ddef","oldExecTime":"2021-05-21 11:26","execTime":"2021-05-21 11:26","execStatus":2,"execIf":0,"waitDevice":"52ad5bd5d01644eb981dc69f552e1d73","endTime":"2021-05-21 11:29:55","bz":null,"task":{"taskId":"a32dd5333f1043798b4633bf8a55ddef","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052116","status":3,"createTime":"2021-05-21 11:25:46","execTime":"2021-05-21 11:29:56","road":0,"overTime":null,"creater":"admin","content":null,"devices":"993b0c3c0cb842f5a80af6046b556f0b,52ad5bd5d01644eb981dc69f552e1d73","endStatus":1,"result":null,"description":null,"robotId":"4d472b34ab084aa4a6fb3e954bf33420","periodStime":null,"periodEtime":null}},{"robotTaskId":"c753ecfbd73c484d9d98b5922b28ffa8","robotId":"4d472b34ab084aa4a6fb3e954bf33420","taskId":"bc4c3a7062624c7c992f0ba7dc5e3b52","oldExecTime":"2021-05-21 11:21","execTime":"2021-05-21 11:21","execStatus":2,"execIf":0,"waitDevice":"52ad5bd5d01644eb981dc69f552e1d73","endTime":"2021-05-21 11:25:28","bz":null,"task":{"taskId":"bc4c3a7062624c7c992f0ba7dc5e3b52","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052115","status":3,"createTime":"2021-05-21 11:21:04","execTime":"2021-05-21 11:25:28","road":0,"overTime":null,"creater":"admin","content":null,"devices":"993b0c3c0cb842f5a80af6046b556f0b,52ad5bd5d01644eb981dc69f552e1d73","endStatus":1,"result":null,"description":null,"robotId":"4d472b34ab084aa4a6fb3e954bf33420","periodStime":null,"periodEtime":null}},{"robotTaskId":"15d79c8ca9244d18ba88d2662203b8ee","robotId":"4d472b34ab084aa4a6fb3e954bf33420","taskId":"4133239a76b34f83bef472fad0be9344","oldExecTime":"2021-05-21 11:01","execTime":"2021-05-21 11:01","execStatus":2,"execIf":0,"waitDevice":"52ad5bd5d01644eb981dc69f552e1d73","endTime":"2021-05-21 11:03:47","bz":null,"task":{"taskId":"4133239a76b34f83bef472fad0be9344","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052113","status":3,"createTime":"2021-05-21 11:00:50","execTime":"2021-05-21 11:03:47","road":0,"overTime":null,"creater":"admin","content":null,"devices":"993b0c3c0cb842f5a80af6046b556f0b,52ad5bd5d01644eb981dc69f552e1d73","endStatus":1,"result":null,"description":null,"robotId":"4d472b34ab084aa4a6fb3e954bf33420","periodStime":null,"periodEtime":null}},{"robotTaskId":"3701811333bc47c1b93384f44d6e4b61","robotId":"4d472b34ab084aa4a6fb3e954bf33420","taskId":"8537980e9e7741ba9a8b24789152355e","oldExecTime":"2021-05-21 10:49","execTime":"2021-05-21 10:49","execStatus":2,"execIf":0,"waitDevice":"52ad5bd5d01644eb981dc69f552e1d73","endTime":"2021-05-21 10:52:34","bz":null,"task":{"taskId":"8537980e9e7741ba9a8b24789152355e","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052110","status":3,"createTime":"2021-05-21 10:49:47","execTime":"2021-05-21 10:52:34","road":0,"overTime":null,"creater":"admin","content":null,"devices":"993b0c3c0cb842f5a80af6046b556f0b,52ad5bd5d01644eb981dc69f552e1d73","endStatus":1,"result":null,"description":null,"robotId":"4d472b34ab084aa4a6fb3e954bf33420","periodStime":null,"periodEtime":null}},{"robotTaskId":"66e7b306a36a45738a5006cd68927bc2","robotId":"4d472b34ab084aa4a6fb3e954bf33420","taskId":"f15d722427214690a462e6abc0f5abe3","oldExecTime":"2021-05-21 10:38","execTime":"2021-05-21 10:38","execStatus":2,"execIf":0,"waitDevice":"52ad5bd5d01644eb981dc69f552e1d73","endTime":"2021-05-21 10:42:01","bz":null,"task":{"taskId":"f15d722427214690a462e6abc0f5abe3","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052108","status":3,"createTime":"2021-05-21 10:38:01","execTime":"2021-05-21 10:42:01","road":0,"overTime":null,"creater":"admin","content":null,"devices":"993b0c3c0cb842f5a80af6046b556f0b,52ad5bd5d01644eb981dc69f552e1d73","endStatus":1,"result":null,"description":null,"robotId":"4d472b34ab084aa4a6fb3e954bf33420","periodStime":null,"periodEtime":null}},{"robotTaskId":"1283f566d8d84af0bd90bc294c607a63","robotId":"4d472b34ab084aa4a6fb3e954bf33420","taskId":"8091ef5b5a33409bbb183d2c436f9030","oldExecTime":"2021-05-21 10:34","execTime":"2021-05-21 10:34","execStatus":2,"execIf":0,"waitDevice":"52ad5bd5d01644eb981dc69f552e1d73","endTime":"2021-05-21 10:37:13","bz":null,"task":{"taskId":"8091ef5b5a33409bbb183d2c436f9030","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052107","status":3,"createTime":"2021-05-21 10:33:47","execTime":"2021-05-21 10:37:13","road":0,"overTime":null,"creater":"admin","content":null,"devices":"993b0c3c0cb842f5a80af6046b556f0b,52ad5bd5d01644eb981dc69f552e1d73","endStatus":1,"result":null,"description":null,"robotId":"4d472b34ab084aa4a6fb3e954bf33420","periodStime":null,"periodEtime":null}},{"robotTaskId":"3614e3eee8c544a29c925ba4ff152b8c","robotId":"4d472b34ab084aa4a6fb3e954bf33420","taskId":"d41e86d59d3c47c5863732af2aedbb72","oldExecTime":"2021-05-21 10:28","execTime":"2021-05-21 10:28","execStatus":2,"execIf":0,"waitDevice":"52ad5bd5d01644eb981dc69f552e1d73","endTime":"2021-05-21 10:32:12","bz":null,"task":{"taskId":"d41e86d59d3c47c5863732af2aedbb72","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052106","status":3,"createTime":"2021-05-21 10:28:03","execTime":"2021-05-21 10:32:12","road":0,"overTime":null,"creater":"admin","content":null,"devices":"993b0c3c0cb842f5a80af6046b556f0b,52ad5bd5d01644eb981dc69f552e1d73","endStatus":1,"result":null,"description":null,"robotId":"4d472b34ab084aa4a6fb3e954bf33420","periodStime":null,"periodEtime":null}},{"robotTaskId":"2a61c8e9d86b41dead81b140e22c122f","robotId":"4d472b34ab084aa4a6fb3e954bf33420","taskId":"1597f222d4a94cb986b65d462f03261a","oldExecTime":"2021-05-20 15:17","execTime":"2021-05-20 15:17","execStatus":2,"execIf":0,"waitDevice":"7a071abf13124c13b83e1c42f77ef748","endTime":"2021-05-20 15:22:19","bz":null,"task":{"taskId":"1597f222d4a94cb986b65d462f03261a","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052012","status":3,"createTime":"2021-05-20 15:17:01","execTime":"2021-05-20 15:22:19","road":0,"overTime":null,"creater":"admin","content":null,"devices":"dc985b9fbc174f619d4b6b43cb8447e2,7a071abf13124c13b83e1c42f77ef748","endStatus":1,"result":null,"description":null,"robotId":"4d472b34ab084aa4a6fb3e954bf33420","periodStime":null,"periodEtime":null}},{"robotTaskId":"970c7fc1d1f8438b87ba40010180cfb1","robotId":"4d472b34ab084aa4a6fb3e954bf33420","taskId":"17ccdd9f1f424c919066b84ee15ba8ff","oldExecTime":"2021-05-20 11:02","execTime":"2021-05-20 11:02","execStatus":2,"execIf":0,"waitDevice":"22800d9843ed43f1a14ef8c9549003f1","endTime":"2021-05-20 11:07:14","bz":null,"task":{"taskId":"17ccdd9f1f424c919066b84ee15ba8ff","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052008","status":3,"createTime":"2021-05-20 11:02:01","execTime":"2021-05-20 11:07:14","road":0,"overTime":null,"creater":"admin","content":null,"devices":"79c963e98dee458bb92bbdfa3af84cb0,22800d9843ed43f1a14ef8c9549003f1","endStatus":1,"result":null,"description":null,"robotId":"4d472b34ab084aa4a6fb3e954bf33420","periodStime":null,"periodEtime":null}},{"robotTaskId":"cb5e60daf78f44f0b00b216938c97840","robotId":"4d472b34ab084aa4a6fb3e954bf33420","taskId":"1824fa673b4f4b9184e92f074ca9311c","oldExecTime":"2021-05-20 10:52","execTime":"2021-05-20 10:52","execStatus":2,"execIf":0,"waitDevice":"22800d9843ed43f1a14ef8c9549003f1","endTime":"2021-05-20 10:56:42","bz":null,"task":{"taskId":"1824fa673b4f4b9184e92f074ca9311c","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052007","status":3,"createTime":"2021-05-20 10:34:30","execTime":"2021-05-20 10:56:42","road":0,"overTime":null,"creater":"admin","content":null,"devices":"79c963e98dee458bb92bbdfa3af84cb0,22800d9843ed43f1a14ef8c9549003f1","endStatus":1,"result":null,"description":null,"robotId":"4d472b34ab084aa4a6fb3e954bf33420","periodStime":null,"periodEtime":null}},{"robotTaskId":"288abd9d8741453cb4a08325fee0e1ee","robotId":"4d472b34ab084aa4a6fb3e954bf33420","taskId":"b37de93a1166493d97c71466e4ca2846","oldExecTime":"2021-05-20 09:59","execTime":"2021-05-20 09:59","execStatus":2,"execIf":0,"waitDevice":"f42a43ffd32a404db867a222fc8842bc","endTime":"2021-05-20 09:59:34","bz":null,"task":{"taskId":"b37de93a1166493d97c71466e4ca2846","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052001","status":3,"createTime":"2021-05-20 09:58:31","execTime":"2021-05-20 09:59:34","road":0,"overTime":null,"creater":"admin","content":null,"devices":"f42a43ffd32a404db867a222fc8842bc","endStatus":1,"result":null,"description":null,"robotId":"4d472b34ab084aa4a6fb3e954bf33420","periodStime":null,"periodEtime":null}},{"robotTaskId":"986b70cb82fa4f4ab12558459b5d2268","robotId":"4d472b34ab084aa4a6fb3e954bf33420","taskId":"39e78712eed347abb22419a647a8daf5","oldExecTime":"2021-05-19 18:28","execTime":"2021-05-19 18:28","execStatus":2,"execIf":0,"waitDevice":"61763fcc3b184db093006acd8a56055b","endTime":"2021-05-19 18:30:22","bz":null,"task":{"taskId":"39e78712eed347abb22419a647a8daf5","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021051907","status":3,"createTime":"2021-05-19 18:27:50","execTime":"2021-05-19 18:30:22","road":0,"overTime":null,"creater":"admin","content":null,"devices":"61763fcc3b184db093006acd8a56055b","endStatus":1,"result":null,"description":null,"robotId":"4d472b34ab084aa4a6fb3e954bf33420","periodStime":null,"periodEtime":null}},{"robotTaskId":"c9f8415e25a04efeb55d73ee06160477","robotId":"4d472b34ab084aa4a6fb3e954bf33420","taskId":"2bb6d122d9e743e08a6be1db1d100fb3","oldExecTime":"2021-05-19 18:16","execTime":"2021-05-19 18:16","execStatus":2,"execIf":0,"waitDevice":"61763fcc3b184db093006acd8a56055b","endTime":"2021-05-19 18:18:44","bz":null,"task":{"taskId":"2bb6d122d9e743e08a6be1db1d100fb3","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021051908","status":3,"createTime":"2021-05-19 18:16:08","execTime":"2021-05-19 18:18:44","road":0,"overTime":null,"creater":"admin","content":null,"devices":"61763fcc3b184db093006acd8a56055b","endStatus":1,"result":null,"description":null,"robotId":"4d472b34ab084aa4a6fb3e954bf33420","periodStime":null,"periodEtime":null}},{"robotTaskId":"6858579bc95a439287174e92dd178025","robotId":"4d472b34ab084aa4a6fb3e954bf33420","taskId":"0ca33c4b657044e084728e1e42d30d39","oldExecTime":"2021-05-19 17:10","execTime":"2021-05-19 17:10","execStatus":2,"execIf":0,"waitDevice":"61763fcc3b184db093006acd8a56055b","endTime":"2021-05-19 17:35:07","bz":null,"task":{"taskId":"0ca33c4b657044e084728e1e42d30d39","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021051907","status":3,"createTime":"2021-05-19 16:54:51","execTime":"2021-05-19 17:35:07","road":0,"overTime":null,"creater":"admin","content":null,"devices":"61763fcc3b184db093006acd8a56055b","endStatus":1,"result":null,"description":null,"robotId":"4d472b34ab084aa4a6fb3e954bf33420","periodStime":null,"periodEtime":null}},{"robotTaskId":"25c8912c83294be6afeed2ddaa20d357","robotId":"4d472b34ab084aa4a6fb3e954bf33420","taskId":"ead7d3699caa42e48630e784d5e3e3ba","oldExecTime":"2021-05-19 16:37","execTime":"2021-05-19 16:37","execStatus":2,"execIf":0,"waitDevice":"01b54561c5f145cdb5c8a3708db15c84","endTime":"2021-05-19 16:38:49","bz":null,"task":{"taskId":"ead7d3699caa42e48630e784d5e3e3ba","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021051903","status":3,"createTime":"2021-05-19 16:37:31","execTime":"2021-05-19 16:38:49","road":0,"overTime":null,"creater":"admin","content":null,"devices":"01b54561c5f145cdb5c8a3708db15c84","endStatus":1,"result":null,"description":null,"robotId":"4d472b34ab084aa4a6fb3e954bf33420","periodStime":null,"periodEtime":null}},{"robotTaskId":"67077f4ead4149948ebfd4da3dad776c","robotId":"4d472b34ab084aa4a6fb3e954bf33420","taskId":"e931b587833d4b95978ae4859da41224","oldExecTime":"2021-05-19 16:24","execTime":"2021-05-19 16:24","execStatus":2,"execIf":0,"waitDevice":"01b54561c5f145cdb5c8a3708db15c84","endTime":"2021-05-19 16:24:56","bz":null,"task":{"taskId":"e931b587833d4b95978ae4859da41224","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021051902","status":3,"createTime":"2021-05-19 16:24:18","execTime":"2021-05-19 16:24:56","road":0,"overTime":null,"creater":"admin","content":null,"devices":"01b54561c5f145cdb5c8a3708db15c84","endStatus":1,"result":null,"description":null,"robotId":"4d472b34ab084aa4a6fb3e954bf33420","periodStime":null,"periodEtime":null}}],"totalElements":28}'
    # rospText = '{"content":[{"robotTaskId":"8978d773cd16477baa37be161f29bff7","robotId":"c4b71eb124a7418aa14d4dd0dd383fae","taskId":"d238df3119114ea2af9d7a1bacfd4c2e","oldExecTime":"2021-05-21 16:27","execTime":"2021-05-21 16:27","execStatus":2,"execIf":0,"waitDevice":"52ad5bd5d01644eb981dc69f552e1d73","endTime":"2021-05-21 16:30:38","bz":null,"task":{"taskId":"d238df3119114ea2af9d7a1bacfd4c2e","taskExecType":0,"taskType":0,"cron":"2021-05-21 15:53:34,2021-05-21 16:00:34","period":"","name":"2021052124","status":3,"createTime":"2021-05-21 16:27:09","execTime":"2021-05-21 16:30:38","road":0,"overTime":null,"creater":"admin","content":null,"devices":"993b0c3c0cb842f5a80af6046b556f0b,52ad5bd5d01644eb981dc69f552e1d73","endStatus":1,"result":null,"description":null,"robotId":"c4b71eb124a7418aa14d4dd0dd383fae","periodStime":null,"periodEtime":null}},{"robotTaskId":"b1aa643ebe004e8d9f6b4dfe91e902e6","robotId":"c4b71eb124a7418aa14d4dd0dd383fae","taskId":"fbc44a68a3fa468a97d1256e1a43ff43","oldExecTime":"2021-05-21 15:36","execTime":"2021-05-21 15:36","execStatus":2,"execIf":0,"waitDevice":"52ad5bd5d01644eb981dc69f552e1d73","endTime":"2021-05-21 15:38:57","bz":null,"task":{"taskId":"fbc44a68a3fa468a97d1256e1a43ff43","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052121","status":3,"createTime":"2021-05-21 15:36:41","execTime":"2021-05-21 15:38:57","road":0,"overTime":null,"creater":"admin","content":null,"devices":"993b0c3c0cb842f5a80af6046b556f0b,52ad5bd5d01644eb981dc69f552e1d73","endStatus":1,"result":null,"description":null,"robotId":"c4b71eb124a7418aa14d4dd0dd383fae","periodStime":null,"periodEtime":null}},{"robotTaskId":"1eadc67c3c624d748aec01154d32c20d","robotId":"c4b71eb124a7418aa14d4dd0dd383fae","taskId":"c1cc3929b3f74c548095e5eaffbacbd9","oldExecTime":"2021-05-21 15:29","execTime":"2021-05-21 15:29","execStatus":2,"execIf":0,"waitDevice":"52ad5bd5d01644eb981dc69f552e1d73","endTime":"2021-05-21 15:33:30","bz":null,"task":{"taskId":"c1cc3929b3f74c548095e5eaffbacbd9","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052120","status":3,"createTime":"2021-05-21 15:29:16","execTime":"2021-05-21 15:33:30","road":0,"overTime":null,"creater":"admin","content":null,"devices":"993b0c3c0cb842f5a80af6046b556f0b,52ad5bd5d01644eb981dc69f552e1d73","endStatus":1,"result":null,"description":null,"robotId":"c4b71eb124a7418aa14d4dd0dd383fae","periodStime":null,"periodEtime":null}},{"robotTaskId":"b23c37a7e75d44539bd04364d7c8e38d","robotId":"c4b71eb124a7418aa14d4dd0dd383fae","taskId":"66bf1e39a4214bb0b55d15dca2c22870","oldExecTime":"2021-05-21 15:18","execTime":"2021-05-21 15:18","execStatus":2,"execIf":0,"waitDevice":"52ad5bd5d01644eb981dc69f552e1d73","endTime":"2021-05-21 15:22:08","bz":null,"task":{"taskId":"66bf1e39a4214bb0b55d15dca2c22870","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052118","status":3,"createTime":"2021-05-21 15:18:00","execTime":"2021-05-21 15:22:08","road":0,"overTime":null,"creater":"admin","content":null,"devices":"993b0c3c0cb842f5a80af6046b556f0b,52ad5bd5d01644eb981dc69f552e1d73","endStatus":1,"result":null,"description":null,"robotId":"c4b71eb124a7418aa14d4dd0dd383fae","periodStime":null,"periodEtime":null}},{"robotTaskId":"bf21075461854c50ab800430d0183f3c","robotId":"c4b71eb124a7418aa14d4dd0dd383fae","taskId":"a32dd5333f1043798b4633bf8a55ddef","oldExecTime":"2021-05-21 11:26","execTime":"2021-05-21 11:26","execStatus":2,"execIf":0,"waitDevice":"52ad5bd5d01644eb981dc69f552e1d73","endTime":"2021-05-21 11:29:55","bz":null,"task":{"taskId":"a32dd5333f1043798b4633bf8a55ddef","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052116","status":3,"createTime":"2021-05-21 11:25:46","execTime":"2021-05-21 11:29:56","road":0,"overTime":null,"creater":"admin","content":null,"devices":"993b0c3c0cb842f5a80af6046b556f0b,52ad5bd5d01644eb981dc69f552e1d73","endStatus":1,"result":null,"description":null,"robotId":"c4b71eb124a7418aa14d4dd0dd383fae","periodStime":null,"periodEtime":null}},{"robotTaskId":"c753ecfbd73c484d9d98b5922b28ffa8","robotId":"c4b71eb124a7418aa14d4dd0dd383fae","taskId":"bc4c3a7062624c7c992f0ba7dc5e3b52","oldExecTime":"2021-05-21 11:21","execTime":"2021-05-21 11:21","execStatus":2,"execIf":0,"waitDevice":"52ad5bd5d01644eb981dc69f552e1d73","endTime":"2021-05-21 11:25:28","bz":null,"task":{"taskId":"bc4c3a7062624c7c992f0ba7dc5e3b52","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052115","status":3,"createTime":"2021-05-21 11:21:04","execTime":"2021-05-21 11:25:28","road":0,"overTime":null,"creater":"admin","content":null,"devices":"993b0c3c0cb842f5a80af6046b556f0b,52ad5bd5d01644eb981dc69f552e1d73","endStatus":1,"result":null,"description":null,"robotId":"c4b71eb124a7418aa14d4dd0dd383fae","periodStime":null,"periodEtime":null}},{"robotTaskId":"15d79c8ca9244d18ba88d2662203b8ee","robotId":"c4b71eb124a7418aa14d4dd0dd383fae","taskId":"4133239a76b34f83bef472fad0be9344","oldExecTime":"2021-05-21 11:01","execTime":"2021-05-21 11:01","execStatus":2,"execIf":0,"waitDevice":"52ad5bd5d01644eb981dc69f552e1d73","endTime":"2021-05-21 11:03:47","bz":null,"task":{"taskId":"4133239a76b34f83bef472fad0be9344","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052113","status":3,"createTime":"2021-05-21 11:00:50","execTime":"2021-05-21 11:03:47","road":0,"overTime":null,"creater":"admin","content":null,"devices":"993b0c3c0cb842f5a80af6046b556f0b,52ad5bd5d01644eb981dc69f552e1d73","endStatus":1,"result":null,"description":null,"robotId":"c4b71eb124a7418aa14d4dd0dd383fae","periodStime":null,"periodEtime":null}},{"robotTaskId":"3701811333bc47c1b93384f44d6e4b61","robotId":"c4b71eb124a7418aa14d4dd0dd383fae","taskId":"8537980e9e7741ba9a8b24789152355e","oldExecTime":"2021-05-21 10:49","execTime":"2021-05-21 10:49","execStatus":2,"execIf":0,"waitDevice":"52ad5bd5d01644eb981dc69f552e1d73","endTime":"2021-05-21 10:52:34","bz":null,"task":{"taskId":"8537980e9e7741ba9a8b24789152355e","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052110","status":3,"createTime":"2021-05-21 10:49:47","execTime":"2021-05-21 10:52:34","road":0,"overTime":null,"creater":"admin","content":null,"devices":"993b0c3c0cb842f5a80af6046b556f0b,52ad5bd5d01644eb981dc69f552e1d73","endStatus":1,"result":null,"description":null,"robotId":"c4b71eb124a7418aa14d4dd0dd383fae","periodStime":null,"periodEtime":null}},{"robotTaskId":"66e7b306a36a45738a5006cd68927bc2","robotId":"c4b71eb124a7418aa14d4dd0dd383fae","taskId":"f15d722427214690a462e6abc0f5abe3","oldExecTime":"2021-05-21 10:38","execTime":"2021-05-21 10:38","execStatus":2,"execIf":0,"waitDevice":"52ad5bd5d01644eb981dc69f552e1d73","endTime":"2021-05-21 10:42:01","bz":null,"task":{"taskId":"f15d722427214690a462e6abc0f5abe3","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052108","status":3,"createTime":"2021-05-21 10:38:01","execTime":"2021-05-21 10:42:01","road":0,"overTime":null,"creater":"admin","content":null,"devices":"993b0c3c0cb842f5a80af6046b556f0b,52ad5bd5d01644eb981dc69f552e1d73","endStatus":1,"result":null,"description":null,"robotId":"c4b71eb124a7418aa14d4dd0dd383fae","periodStime":null,"periodEtime":null}},{"robotTaskId":"1283f566d8d84af0bd90bc294c607a63","robotId":"c4b71eb124a7418aa14d4dd0dd383fae","taskId":"8091ef5b5a33409bbb183d2c436f9030","oldExecTime":"2021-05-21 10:34","execTime":"2021-05-21 10:34","execStatus":2,"execIf":0,"waitDevice":"52ad5bd5d01644eb981dc69f552e1d73","endTime":"2021-05-21 10:37:13","bz":null,"task":{"taskId":"8091ef5b5a33409bbb183d2c436f9030","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052107","status":3,"createTime":"2021-05-21 10:33:47","execTime":"2021-05-21 10:37:13","road":0,"overTime":null,"creater":"admin","content":null,"devices":"993b0c3c0cb842f5a80af6046b556f0b,52ad5bd5d01644eb981dc69f552e1d73","endStatus":1,"result":null,"description":null,"robotId":"c4b71eb124a7418aa14d4dd0dd383fae","periodStime":null,"periodEtime":null}},{"robotTaskId":"3614e3eee8c544a29c925ba4ff152b8c","robotId":"c4b71eb124a7418aa14d4dd0dd383fae","taskId":"d41e86d59d3c47c5863732af2aedbb72","oldExecTime":"2021-05-21 10:28","execTime":"2021-05-21 10:28","execStatus":2,"execIf":0,"waitDevice":"52ad5bd5d01644eb981dc69f552e1d73","endTime":"2021-05-21 10:32:12","bz":null,"task":{"taskId":"d41e86d59d3c47c5863732af2aedbb72","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052106","status":3,"createTime":"2021-05-21 10:28:03","execTime":"2021-05-21 10:32:12","road":0,"overTime":null,"creater":"admin","content":null,"devices":"993b0c3c0cb842f5a80af6046b556f0b,52ad5bd5d01644eb981dc69f552e1d73","endStatus":1,"result":null,"description":null,"robotId":"c4b71eb124a7418aa14d4dd0dd383fae","periodStime":null,"periodEtime":null}},{"robotTaskId":"2a61c8e9d86b41dead81b140e22c122f","robotId":"c4b71eb124a7418aa14d4dd0dd383fae","taskId":"1597f222d4a94cb986b65d462f03261a","oldExecTime":"2021-05-20 15:17","execTime":"2021-05-20 15:17","execStatus":2,"execIf":0,"waitDevice":"7a071abf13124c13b83e1c42f77ef748","endTime":"2021-05-20 15:22:19","bz":null,"task":{"taskId":"1597f222d4a94cb986b65d462f03261a","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052012","status":3,"createTime":"2021-05-20 15:17:01","execTime":"2021-05-20 15:22:19","road":0,"overTime":null,"creater":"admin","content":null,"devices":"dc985b9fbc174f619d4b6b43cb8447e2,7a071abf13124c13b83e1c42f77ef748","endStatus":1,"result":null,"description":null,"robotId":"c4b71eb124a7418aa14d4dd0dd383fae","periodStime":null,"periodEtime":null}},{"robotTaskId":"970c7fc1d1f8438b87ba40010180cfb1","robotId":"c4b71eb124a7418aa14d4dd0dd383fae","taskId":"17ccdd9f1f424c919066b84ee15ba8ff","oldExecTime":"2021-05-20 11:02","execTime":"2021-05-20 11:02","execStatus":2,"execIf":0,"waitDevice":"22800d9843ed43f1a14ef8c9549003f1","endTime":"2021-05-20 11:07:14","bz":null,"task":{"taskId":"17ccdd9f1f424c919066b84ee15ba8ff","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052008","status":3,"createTime":"2021-05-20 11:02:01","execTime":"2021-05-20 11:07:14","road":0,"overTime":null,"creater":"admin","content":null,"devices":"79c963e98dee458bb92bbdfa3af84cb0,22800d9843ed43f1a14ef8c9549003f1","endStatus":1,"result":null,"description":null,"robotId":"c4b71eb124a7418aa14d4dd0dd383fae","periodStime":null,"periodEtime":null}},{"robotTaskId":"cb5e60daf78f44f0b00b216938c97840","robotId":"c4b71eb124a7418aa14d4dd0dd383fae","taskId":"1824fa673b4f4b9184e92f074ca9311c","oldExecTime":"2021-05-20 10:52","execTime":"2021-05-20 10:52","execStatus":2,"execIf":0,"waitDevice":"22800d9843ed43f1a14ef8c9549003f1","endTime":"2021-05-20 10:56:42","bz":null,"task":{"taskId":"1824fa673b4f4b9184e92f074ca9311c","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052007","status":3,"createTime":"2021-05-20 10:34:30","execTime":"2021-05-20 10:56:42","road":0,"overTime":null,"creater":"admin","content":null,"devices":"79c963e98dee458bb92bbdfa3af84cb0,22800d9843ed43f1a14ef8c9549003f1","endStatus":1,"result":null,"description":null,"robotId":"c4b71eb124a7418aa14d4dd0dd383fae","periodStime":null,"periodEtime":null}},{"robotTaskId":"288abd9d8741453cb4a08325fee0e1ee","robotId":"c4b71eb124a7418aa14d4dd0dd383fae","taskId":"b37de93a1166493d97c71466e4ca2846","oldExecTime":"2021-05-20 09:59","execTime":"2021-05-20 09:59","execStatus":2,"execIf":0,"waitDevice":"f42a43ffd32a404db867a222fc8842bc","endTime":"2021-05-20 09:59:34","bz":null,"task":{"taskId":"b37de93a1166493d97c71466e4ca2846","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021052001","status":3,"createTime":"2021-05-20 09:58:31","execTime":"2021-05-20 09:59:34","road":0,"overTime":null,"creater":"admin","content":null,"devices":"f42a43ffd32a404db867a222fc8842bc","endStatus":1,"result":null,"description":null,"robotId":"c4b71eb124a7418aa14d4dd0dd383fae","periodStime":null,"periodEtime":null}},{"robotTaskId":"986b70cb82fa4f4ab12558459b5d2268","robotId":"c4b71eb124a7418aa14d4dd0dd383fae","taskId":"39e78712eed347abb22419a647a8daf5","oldExecTime":"2021-05-19 18:28","execTime":"2021-05-19 18:28","execStatus":2,"execIf":0,"waitDevice":"61763fcc3b184db093006acd8a56055b","endTime":"2021-05-19 18:30:22","bz":null,"task":{"taskId":"39e78712eed347abb22419a647a8daf5","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021051907","status":3,"createTime":"2021-05-19 18:27:50","execTime":"2021-05-19 18:30:22","road":0,"overTime":null,"creater":"admin","content":null,"devices":"61763fcc3b184db093006acd8a56055b","endStatus":1,"result":null,"description":null,"robotId":"c4b71eb124a7418aa14d4dd0dd383fae","periodStime":null,"periodEtime":null}},{"robotTaskId":"c9f8415e25a04efeb55d73ee06160477","robotId":"c4b71eb124a7418aa14d4dd0dd383fae","taskId":"2bb6d122d9e743e08a6be1db1d100fb3","oldExecTime":"2021-05-19 18:16","execTime":"2021-05-19 18:16","execStatus":2,"execIf":0,"waitDevice":"61763fcc3b184db093006acd8a56055b","endTime":"2021-05-19 18:18:44","bz":null,"task":{"taskId":"2bb6d122d9e743e08a6be1db1d100fb3","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021051908","status":3,"createTime":"2021-05-19 18:16:08","execTime":"2021-05-19 18:18:44","road":0,"overTime":null,"creater":"admin","content":null,"devices":"61763fcc3b184db093006acd8a56055b","endStatus":1,"result":null,"description":null,"robotId":"c4b71eb124a7418aa14d4dd0dd383fae","periodStime":null,"periodEtime":null}},{"robotTaskId":"6858579bc95a439287174e92dd178025","robotId":"c4b71eb124a7418aa14d4dd0dd383fae","taskId":"0ca33c4b657044e084728e1e42d30d39","oldExecTime":"2021-05-19 17:10","execTime":"2021-05-19 17:10","execStatus":2,"execIf":0,"waitDevice":"61763fcc3b184db093006acd8a56055b","endTime":"2021-05-19 17:35:07","bz":null,"task":{"taskId":"0ca33c4b657044e084728e1e42d30d39","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021051907","status":3,"createTime":"2021-05-19 16:54:51","execTime":"2021-05-19 17:35:07","road":0,"overTime":null,"creater":"admin","content":null,"devices":"61763fcc3b184db093006acd8a56055b","endStatus":1,"result":null,"description":null,"robotId":"c4b71eb124a7418aa14d4dd0dd383fae","periodStime":null,"periodEtime":null}},{"robotTaskId":"25c8912c83294be6afeed2ddaa20d357","robotId":"c4b71eb124a7418aa14d4dd0dd383fae","taskId":"ead7d3699caa42e48630e784d5e3e3ba","oldExecTime":"2021-05-19 16:37","execTime":"2021-05-19 16:37","execStatus":2,"execIf":0,"waitDevice":"01b54561c5f145cdb5c8a3708db15c84","endTime":"2021-05-19 16:38:49","bz":null,"task":{"taskId":"ead7d3699caa42e48630e784d5e3e3ba","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021051903","status":3,"createTime":"2021-05-19 16:37:31","execTime":"2021-05-19 16:38:49","road":0,"overTime":null,"creater":"admin","content":null,"devices":"01b54561c5f145cdb5c8a3708db15c84","endStatus":1,"result":null,"description":null,"robotId":"c4b71eb124a7418aa14d4dd0dd383fae","periodStime":null,"periodEtime":null}},{"robotTaskId":"67077f4ead4149948ebfd4da3dad776c","robotId":"c4b71eb124a7418aa14d4dd0dd383fae","taskId":"e931b587833d4b95978ae4859da41224","oldExecTime":"2021-05-19 16:24","execTime":"2021-05-19 16:24","execStatus":2,"execIf":0,"waitDevice":"01b54561c5f145cdb5c8a3708db15c84","endTime":"2021-05-19 16:24:56","bz":null,"task":{"taskId":"e931b587833d4b95978ae4859da41224","taskExecType":0,"taskType":0,"cron":"","period":"","name":"2021051902","status":3,"createTime":"2021-05-19 16:24:18","execTime":"2021-05-19 16:24:56","road":0,"overTime":null,"creater":"admin","content":null,"devices":"01b54561c5f145cdb5c8a3708db15c84","endStatus":1,"result":null,"description":null,"robotId":"c4b71eb124a7418aa14d4dd0dd383fae","periodStime":null,"periodEtime":null}}],"totalElements":28}'
    dic = {}
    ResponseCodeCheck().code_all(respStatus,rospText,code_suc)

    # print(dis.keys())
